#coding=utf-8
sum=0
fac=1
num = int(input('请输入一个数：'))
for i in range(1,num+1):
    fac=fac*i
    sum +=fac
print('阶乘之和：',sum)